//
//  CCUIButton.h
//  CCFC_IPHONE
//
//  Created by  xuchen(陈旭)， xichen(陈曦)， qq：511272827 on 10-10-28.
//  Copyright 2010 cc_team. All rights reserved.
//
#ifndef	CC_UI_BUTTON
#define	CC_UI_BUTTON

#include "CCAll.h"

#ifdef OBJC_MACRO
#import <UIKit/UIKit.h>

//单击事件宏
#define	UIControlEventClick		UIControlEventTouchUpInside
#define	EventClick				UIControlEventClick

#define	CREATE_CUSTOM_BUTTON	[UIButton buttonWithType:UIButtonTypeCustom]
#define	SET_BUTTON_BG_IMG(button, buttonImage, controlState)		\
		[button setBackgroundImage:(buttonImage) forState:(controlState)]

#endif	//OBJC_MACRO

#ifdef	CPP_MACRO
namespace CC
{
	class Button
	{
	public:
		//创建按钮
		Button(
			   NSString *normalTitle, 
			   NSString *normalImg,
			   NSString *pressedImg,
			   SEL clickAction,
			   id delegate
			   );
		
		Button(
			   NSString *normalTitle, 
			   SEL clickAction,
			   id delegate
			   );
		
		virtual ~Button();
		
		UIButton *getButton();
		void setFrame(CGFloat x, CGFloat y, CGFloat width, CGFloat height);
		
	private:
		UIButton *button;
	};
}
#endif	//CPP_MACRO

#endif	//CC_UI_BUTTON
